package com.neaten.functionArrangement.controller;

import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.text.PDFTextStripper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.*;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;

@RestController
@RequestMapping("/test")
public class TestController {
    public static void main(String[] args) throws IOException {
        String goodsNameStr = "goodsName";
        String monthMapStr = "monthMap";

        File file = new File("C:\\Users\\DC01\\Desktop\\RA433-2024-12-23.pdf");

    }
    private static String readPdf(InputStream inputStream) throws IOException {
        PDDocument document = PDDocument.load(inputStream);
        document.getClass();
        //使用PDFTextStripper 工具
        PDFTextStripper tStripper = new PDFTextStripper();
        //设置文本排序，有规则输出
        tStripper.setSortByPosition(true);
        //获取所有文字信息
        String info = tStripper.getText(document);
        return info;
    }
}
